package com.lc.cehui.ui.activity.land;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.cardview.widget.CardView;

import com.lc.cehui.R;
import com.lc.cehui.app.AppActivity;
import com.lc.cehui.util.constant.EvenConstant;
import com.lc.cehui.util.eventbus.Event;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class RegisterWelcomeActivity extends AppActivity {

    @BindView(R.id.im_dg_qy)
    ImageView imDgQy;
    @BindView(R.id.card_qy)
    CardView cardQy;
    @BindView(R.id.im_dg_gr)
    ImageView imDgGr;
    @BindView(R.id.card_gr)
    CardView cardGr;
    @BindView(R.id.tv_register)
    TextView tvRegister;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_register_welcome;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @OnClick({R.id.card_qy, R.id.card_gr, R.id.tv_register})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.card_qy:
                cardQy.setCardBackgroundColor(getResources().getColor(R.color.blue008));
                cardQy.setCardElevation(7);
                cardGr.setCardBackgroundColor(getResources().getColor(R.color.graybdbd));
                cardGr.setCardElevation(0);
                imDgQy.setVisibility(View.VISIBLE);
                imDgGr.setVisibility(View.GONE);
                break;
            case R.id.card_gr:
                cardGr.setCardBackgroundColor(getResources().getColor(R.color.blue008));
                cardGr.setCardElevation(7);
                cardQy.setCardBackgroundColor(getResources().getColor(R.color.graybdbd));
                cardQy.setCardElevation(0);
                imDgQy.setVisibility(View.GONE);
                imDgGr.setVisibility(View.VISIBLE);
                break;
            case R.id.tv_register:
                if (imDgGr.getVisibility() == View.VISIBLE){
                    startActivity(RegisterPersonalActivity.class);
                } else {
                    startActivity(RegisterEnterpriseActivity.class);
                }
                break;
        }
    }
    @Override
    protected boolean isRegisterEventBus() {
        return true;
    }

    @Override
    protected void receiveEvent(Event event) {
        super.receiveEvent(event);
        if (event.getCode() == EvenConstant.REGISTERFINSH) {
           finish();
        }


    }
}